package org.tc.common;

/**
 * Created by zxd on 2018/1/29.
 */
public class ResultUtils {

    /**
     * 返回成功  不带返回结果
     * @return
     */
    public static Result buildSuccess(){
        Result result=new Result();
        result.setStatus("success");
        return result;
    }

    /**
     * 返回成功  带返回的结果
     * @param object
     * @return
     */
    public static Result buildSuccess(Object object){
        Result result=new Result();
        result.setStatus("success");
        result.setData(object);
        return result;
    }


    /**
     *
     * @param code  错误状态码
     * @param message  错误具体信息
     * @return
     */
    public static Result buildFail(Integer code,String message){
        Result result=new Result();
        result.setStatus("fail");
        result.setCode(code);
        result.setMessage(message);
        return  result;
    }

}
